#pragma once

#include "IXBaseObj.h"

/**
 *  Interface auto maintain buffer.
 *
 */
class ExportXSkinLib IXAutoBuffer: public IXBaseObj
{
    DEF_INTERFACE(IXAutoBuffer, _T("{6EA63D79-21E1-4213-AB20-CD16CA72B8A5}"));
public:

    /**
     *  Get current buffer.
     *
     *  @param pBuffer    Receive the pointer of current buffer.
     *
     */
    virtual HRESULT STDMETHODCALLTYPE   GetBuffer(OUT void** pBuffer) = 0;

    /**
     *  Get buffer whose size will be dwMinSize at least.
     *
     *  @param pBuffer      Buffer whose size will be dwMinSize at least.
     *  @param dwMinSize    Minimized size of the returned buffer.
     *
     */
    virtual HRESULT STDMETHODCALLTYPE   GetBuffer(OUT void** pBuffer, IN DWORD dwMinSize) = 0;

    /**
     *  Get size of current buffer.
     *
     *  @param pdwSize      Receive size of current buffer.
     *
     */
    virtual HRESULT STDMETHODCALLTYPE   GetSize(OUT DWORD* pdwSize) = 0;
};
